package com.bw.mallshop.adapter;

import android.view.View;

import com.bw.mallshop.R;
import com.bw.mallshop.entity.CategoryEntity;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import org.jetbrains.annotations.NotNull;

public class CategoryAdapter extends BaseQuickAdapter<CategoryEntity, BaseViewHolder> {

    public CategoryAdapter() {
        super(R.layout.item_category);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, CategoryEntity categoryEntity) {
        baseViewHolder.setText(R.id.category_item_tv,categoryEntity.name);
        View view = baseViewHolder.getView(R.id.category_sel_view);
        view.setVisibility(View.GONE);
        if (categoryEntity.selFlag)
            view.setVisibility(View.VISIBLE);
    }

}
